/*
 * crash_protocol_event.cpp
 *
 *  Created on: 07.07.2013
 *      Author: SpirTanol
 */

#include "events/crash_protocol_event.h"
#include "packets/crash_protocol_packet.h"
#include "global.h"

// QT
#include <QDebug>

CrashProtocolEvent::CrashProtocolEvent(const CrashData &data) : ProtocolEvent(QDateTime::fromTime_t(data.oTime), PET_CRASH),
	oCode(data.oCode)
{
	oCur[P_A] = data.oCur[P_A];
	oCur[P_B] = data.oCur[P_B];
	oCur[P_C] = data.oCur[P_C];

	oVol[P_A] = data.oVol[P_A];
	oVol[P_B] = data.oVol[P_B];
	oVol[P_C] = data.oVol[P_C];
}

CrashProtocolEvent::~CrashProtocolEvent()
{

}

QString CrashProtocolEvent::toString() const
{
	return crashText(oCode);
}
